package com.fengxing.ams.web.facade.mouble.college;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fengxing.ams.web.facade.mouble.enrollment.CollegeEnrollmentVO;

@Entity
@Table(name = "zyt_college_base")
public class CollegeVO {
	@Id
	private Integer college_id            ;
	private String owner_type;
	private String gaokao_url            ;
	private String gaokao_id             ;
	private String college_name          ;
	private String location              ;
	private String belongs               ;
	private String education_level       ;
	private String principle             ;
	private String type                  ;
	private Integer qualification_211     ;
	private Integer qualification_985     ;
	private Integer qualification_graduate;
	private String gendar_ratio;
	private String nation_ratio;
	private String batch_ratio;
	private String subject_ratio;
	@Column(name="zyt_order")
	private Integer zytOrder;
	@Column(name="other_order")
	private Integer otherOrder;
	@Transient
	private String pinyin;
	@OneToOne(mappedBy = "collegeVO", fetch = FetchType.LAZY, optional=false)
	private CollegeDetailVO collegeDetailVO;
	
	@OneToMany(cascade=CascadeType.REFRESH , fetch = FetchType.LAZY, mappedBy="collegeVO")
	private List<CollegeEnrollmentVO> collegeEnrollments = new ArrayList<CollegeEnrollmentVO> ();
	
	public String getOwner_type() {
		return owner_type;
	}
	public void setOwner_type(String owner_type) {
		this.owner_type = owner_type;
	}
	public Integer getOtherOrder() {
		return otherOrder;
	}
	public void setOtherOrder(Integer otherOrder) {
		this.otherOrder = otherOrder;
	}
	public Integer getZytOrder() {
		return zytOrder;
	}
	public void setZytOrder(Integer zytOrder) {
		this.zytOrder = zytOrder;
	}
	public String getPinyin() {
		return pinyin;
	}
	public String getGendar_ratio() {
		return gendar_ratio;
	}
	public void setGendar_ratio(String gendar_ratio) {
		this.gendar_ratio = gendar_ratio;
	}
	public String getNation_ratio() {
		return nation_ratio;
	}
	public void setNation_ratio(String nation_ratio) {
		this.nation_ratio = nation_ratio;
	}
	public String getBatch_ratio() {
		return batch_ratio;
	}
	public void setBatch_ratio(String batch_ratio) {
		this.batch_ratio = batch_ratio;
	}
	public String getSubject_ratio() {
		return subject_ratio;
	}
	public void setSubject_ratio(String subject_ratio) {
		this.subject_ratio = subject_ratio;
	}
	public void setPinyin(String pinyin) {
		this.pinyin = pinyin;
	}
	public List<CollegeEnrollmentVO> getCollegeEnrollments() {
		return collegeEnrollments;
	}
	public void setCollegeEnrollments(List<CollegeEnrollmentVO> collegeEnrollments) {
		this.collegeEnrollments = collegeEnrollments;
	}
	public CollegeDetailVO getCollegeDetailVO() {
		return collegeDetailVO;
//		return null;
	}
	public void setCollegeDetailVO(CollegeDetailVO collegeDetailVO) {
		this.collegeDetailVO = collegeDetailVO;
	}
	public Integer getCollege_id() {
		return college_id;
	}
	public void setCollege_id(Integer college_id) {
		this.college_id = college_id;
	}
	public String getGaokao_url() {
		return gaokao_url;
	}
	public void setGaokao_url(String gaokao_url) {
		this.gaokao_url = gaokao_url;
	}
	public String getGaokao_id() {
		return gaokao_id;
	}
	public void setGaokao_id(String gaokao_id) {
		this.gaokao_id = gaokao_id;
	}
	public String getCollege_name() {
		return college_name;
	}
	public void setCollege_name(String college_name) {
		this.college_name = college_name;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public String getBelongs() {
		return belongs;
	}
	public void setBelongs(String belongs) {
		this.belongs = belongs;
	}
	public String getEducation_level() {
		return education_level;
	}
	public void setEducation_level(String education_level) {
		this.education_level = education_level;
	}
	public String getPrinciple() {
		return principle;
	}
	public void setPrinciple(String principle) {
		this.principle = principle;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Integer getQualification_211() {
		return qualification_211;
	}
	public void setQualification_211(Integer qualification_211) {
		this.qualification_211 = qualification_211;
	}
	public Integer getQualification_985() {
		return qualification_985;
	}
	public void setQualification_985(Integer qualification_985) {
		this.qualification_985 = qualification_985;
	}
	public Integer getQualification_graduate() {
		return qualification_graduate;
	}
	public void setQualification_graduate(Integer qualification_graduate) {
		this.qualification_graduate = qualification_graduate;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((college_id == null) ? 0 : college_id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CollegeVO other = (CollegeVO) obj;
		if (college_id == null) {
			if (other.college_id != null)
				return false;
		} else if (!college_id.equals(other.college_id))
			return false;
		return true;
	}
	
}
